home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / lib / galaxy.g < prev    next >
Text File  |  1995-05-04  |  15KB  |  522 lines

  1. (game-module "galaxy"
  2.   (title "Galaxy")
  3.   (blurb "the 24th century")
  4.   (variants (see-all) (world-seen) (world-size))
  5. )
  6.  
  7. ; UNITS
  8.  
  9. (unit-type |photon torpedo| (image-name "pt-gxy")
  10.   (help "shoot these at your enemy"))
  11. (unit-type storm-trooper (image-name "soldiers")
  12.   (help "for capturing planets, moons, & death stars"))
  13. (unit-type |SF-1 fighter| (image-name "f1-gxy")
  14.   (help  "moves fast, can hit most things"))
  15. (unit-type transport (image-name "st-gxy")
  16.   (help "for transporting the troopers"))
  17. (unit-type |light cruiser| (image-name "lc-gxy")
  18.   (help "quick lightly armoured cruiser"))
  19. (unit-type battlecruiser (image-name "cc-gxy")
  20.   (help "specially designed for fleet action"))
  21. (unit-type dreadnought (image-name "dd-gxy")
  22.   (help "heavily armoured with deadly phasers"))
  23. (unit-type |death star| (image-name "deathstar")
  24.   (help "make your enemies afraid, very afraid..."))
  25. (unit-type moon (image-name "moon")
  26.   )
  27. (unit-type planet (image-name "planet")
  28.   (help "makes stuff (esp. cruisers, dreadnoughts & deathstars)"))
  29.  
  30. (define p |photon torpedo|)
  31. (define s storm-trooper)
  32. (define f |SF-1 fighter|)
  33. (define t transport)
  34. (define l |light cruiser|)
  35. (define b battlecruiser)
  36. (define d dreadnought)
  37. (define @ |death star|)
  38. (define x moon)
  39. (define X planet)
  40.  
  41. ; MATERIALS
  42.  
  43. (material-type photons
  44.   (notes "fuels photon torpedos"))
  45. (material-type matter
  46.   (notes "part of the fuel for ships' movement"))
  47. (material-type anti-matter
  48.   (notes "part of the fuel for ships' movement & phasers"))
  49. (material-type o2
  50.   (notes "for the troopers to breathe"))
  51.  
  52. (define ph photons)
  53. (define m matter)
  54. (define a anti-matter)
  55. (define o o2)
  56.  
  57. ; TERRAIN
  58.  
  59. (terrain-type vacuum (color "navy blue") (char "."))
  60. (terrain-type nebula (color "grey") (char "%"))
  61. (terrain-type blackhole (color "black") (char "!"))
  62.  
  63. (set alt-blob-density 10000)
  64. (set alt-blob-height 500)
  65. (set alt-blob-size 200)
  66. (set alt-smoothing 4)
  67. (set wet-blob-density 2000)
  68. (set wet-blob-size 100)
  69.  
  70. (add t* alt-percentile-min ( 0   0  98))
  71. (add t* alt-percentile-max (98  98 100))
  72. (add t* wet-percentile-min ( 0  90   0))
  73. (add t* wet-percentile-max (90 100 100))
  74.  
  75. ; should have low blob density
  76.  
  77. ;; DEFINES
  78.  
  79. (define places (@ x X))
  80. (define planets (x X))
  81. (define movers (p s f t l b d @))
  82. (define starships (t l b d))
  83. (define hosts (t l b d @ x X))
  84. (define guests (p s f))
  85.  
  86. (table vanishes-on
  87.   (u* blackhole true)
  88.   (s t* true) ; no troops allowed out in space
  89. )
  90.  
  91. ;; STARTUP
  92.  
  93. (add places point-value 5000)
  94. (add (s f t l b d @ p) point-value (256 256 255 24 10 200 230 256))
  95.  
  96. (add vacuum country-terrain-min 6)
  97.  
  98. (table favored-terrain
  99.   (places blackhole 0)
  100.   (places vacuum (70 50 85))
  101.   (places nebula (30 50 15))
  102. )
  103. (add (X x t l b d @ s f) start-with (2 3 2 2 2 1 1 4 5))
  104.  
  105. (table independent-density ((X x) vacuum (20 40)))
  106.  
  107. (set country-radius-min 3)
  108. (set country-separation-min 20)
  109. (set country-separation-max 100)
  110.  
  111. (add (X x) already-seen true)
  112. (add (X x) see-always true)
  113.  
  114. ;; Units always start out full of everything.
  115.  
  116. (table unit-initial-supply (u* m* 20000))
  117.  
  118. ;; THINGS OUT OF CONTROL
  119.  
  120. ;10000 blackhole u* accident
  121. ;"has been sucked into a BLACK HOLE!!" u* accident-message
  122.  
  123. ;; THINGS IN CONTROL
  124.  
  125. ;; Production and Repair
  126.  
  127. (add movers cp (3  2  3  8  9 15 30 150))
  128.  
  129. (table acp-to-create
  130.   ((x X) movers 1)
  131.   ((l b d @) p 1)
  132.   (@ f 1)
  133.   )
  134.  
  135. (table cp-on-creation
  136.   ((x X) movers 1)
  137.   (X movers (2 1 1 1 3 4 11 121))
  138.   ((l b d @) p (1 2 3 3))
  139.   (@ f 1)
  140.   )
  141.  
  142. (table acp-to-build
  143.   ((x X) movers 1)
  144.   ((l b d @) p 1)
  145.   (@ f 1)
  146.   )
  147.  
  148. (table cp-per-build
  149.   (u* u* 1)
  150.   )
  151.  
  152. (table material-to-create
  153.   (p ph 5)
  154.   )
  155.  
  156. ;1 movers [ @ x X ] repair
  157. ;1 f starships repair
  158. ;2 d d repair
  159. ;3 starships starships repair
  160.  
  161. ;; Materials
  162.  
  163. (table base-production
  164.   (starships (ph m a) 3)
  165.   (d ph 5)
  166.   (@ m* 30)
  167.   (x m* 40)
  168.   (X m* 50)
  169.   )
  170.  
  171. ;;; the following doesn't make any sense to sts - nebulas
  172. ;;; should be better for material production, not worse
  173. ;100 t* u* productivity
  174. ;50 nebula u* productivity 
  175. ;100 nebula [ x X @ ] productivity
  176.  
  177. (table unit-storage-x
  178.   ;;       p  s  f  t    l   b   d    @    x     X
  179.   (u* ph (01 00 00 00   15  20  30   30   60    90)) 
  180.   (u*  m (00 00 34 1500 300 550 1000 5000 10000 20000))
  181.   (u* o2 (00 01 00 1500 300 550 1000 5000 10000 20000))
  182.   (u*  a (00 00 05 1500 300 550 1000 5000 10000 20000))
  183.   )
  184.  
  185. (table base-consumption
  186.   ((f t l b d) m 1)
  187.   ((f t l b d) a 1)
  188.   (p ph 1)
  189.   (s o2 1) ; storm-troopers must die in space
  190.   )
  191.  
  192. (table consumption-per-move
  193.   (f m 1)
  194.   ((t l b d @) (m a) 1)
  195.   (s o2 1)
  196.   )
  197.  
  198. (table hp-per-starve
  199.   (p ph 1.00)
  200.   (s o2 1.00)
  201.   )
  202.  
  203. ;"has suffocated" s starve-message 
  204. ;"has run out of fuel and disintegrated" f starve-message
  205. ;"missed" p starve-message
  206. ;
  207. ;1 a f hits-with
  208. ;2 a [ t l b d @ x X ] hits-with
  209. ;1 a u* hit-by
  210. ;
  211. ;0 r* u* out-length
  212. ;0 r* u* in-length
  213. ;-1 r* [ f s ] out-length 
  214. ;-1 r* [ x X ] in-length
  215. ;0 s t in-length ; 
  216.  
  217. ; CAPACITY
  218.  
  219. (table unit-capacity-x
  220.   ((l b d) f (1 2 3))
  221.   (t s 5)
  222.   (@ u* 10)
  223.   (@ places 0)
  224.   (@ d 1)
  225.   ((b d) p (2 5))
  226.   (x u* 10)
  227.   (X u* 20)
  228.   (planets planets 0)
  229.   )
  230.  
  231. ;1 u* volume
  232. ;100 u* hold-volume
  233.  
  234. ; MOVEMENT
  235.  
  236. ;                       p s  f t  l  b  d @ x X
  237. (add u* acp-per-turn   (7 1 17 7 12 10 12 4 1 1))
  238.  
  239. (add (x X) speed 0)
  240.  
  241. (table mp-to-enter-terrain
  242.   (u* nebula 2)
  243. )
  244.  
  245. ;17 u* f enter-time
  246. ;100 u* p enter-time
  247.  
  248. (table material-to-move
  249.   (f m 1)
  250.   ((t l b d @) (m a) 1)
  251.   )
  252.  
  253. ;; SIGHT
  254.  
  255. ;80 nebula u* conceal ; nebulas hide stuff
  256.  
  257. ;                     p s f t l b d @ x X
  258. (add u* vision-range (1 1 2 2 3 3 4 7 2 4))
  259.  
  260. ;1 p see-best   ;1
  261. ;0 p see-worst
  262. ;100 [ X x d @ b l ] see-best 
  263. ;60 [ X x d @ b l f t ]  see-worst
  264.  
  265. ;COMBAT
  266.  
  267. ;                        p s f t l b  d  @  x  X
  268. (add u* hp-max          (1 1 2 2 5 9 14 31 25 40))
  269. ;(add u* hp-at-max-speed (0 0 0 1 2 4  5  0  5  5))
  270.  
  271. (table hit-chance
  272. ;;         p  s   f   t   l   b   d   @   x   X
  273.   (p u* ( 00 100 100 100 095 090 085 099 100 100))
  274.   (s u* ( 00 050 010 030 030 030 020 010 050 050))
  275.   (f u* ( 00 050 050 070 040 035 030 002 000 000))
  276.   (t u* ( 00 020 020 050 020 020 020 020 000 000))
  277.   (l u* ( 00 070 070 070 050 035 030 030 000 000))
  278.   (b u* ( 00 090 060 085 065 050 040 040 000 000))
  279.   (d u* ( 00 100 070 095 075 060 050 050 000 000))
  280.   (@ u* ( 00 060 085 090 080 080 080 050 085 060))
  281.   (x u* ( 00 010 010 030 020 010 005 005 000 000))
  282.   (X u* ( 00 020 020 040 030 020 010 010 000 000))
  283.   )
  284.  
  285. (table damage
  286.   (u* u* 1)
  287.   (d u* 2)
  288.   (@ u* 50) ;if you see a death star, you should be terrified
  289.   (@ @ 5)   ; (but not so much if you have one yourself!)
  290.   (f d 2)
  291.   (@ (x X) 999)
  292.   (p u* 2)
  293.   (f @ 999)
  294.   )
  295.  
  296. ;true p self-destruct
  297. ;false p can-counter
  298.  
  299. ;50 guests hosts protect
  300. ;80 u* places protect
  301. ;0 places places protect 
  302. ;30 @ [ x X ] protect 
  303. ;80 p u* protect
  304.  
  305. (table capture-chance
  306.   (s places (020 050 030))
  307.   )
  308.  
  309. (add movers acp-to-disband 1)
  310. (add movers hp-per-disband 99)
  311.  
  312. ;GENERAL STUFF
  313.  
  314. (add u* acp-to-change-side 1)
  315. (add s acp-to-change-side 0)
  316.  
  317. (add s possible-sides (not "independent"))
  318.  
  319. ;"destroyed" u* destroy-message
  320. ;"annihilated" s destroy-message
  321. ;"DESTROYED" places destroy-message
  322. ;"has been attacked by" p destroy-message 
  323. ;"zorched" l destroy-message
  324. ;"ZORCHED" [ b d ] destroy-message
  325.  
  326. (scorekeeper (do last-side-wins))
  327.  
  328. (set action-messages '(
  329.   ((attack p) (sound "explosion-long"))
  330.   ((attack f) (sound "laser"))
  331.   ((attack |SF-1 fighter|) (sound "laser"))
  332.   ((attack l) (sound "laser"))
  333.   ((overrun l) (sound "laser"))
  334.   ((overrun |light cruiser|) (sound "laser"))
  335.   ))
  336.  
  337. ;; NAMES 
  338.  
  339. ;;; Sort of a mishmash, but who cares...
  340.  
  341. (set side-library '(
  342.   (10 (name "Federation") (adjective "Federation"))
  343.   (10 (name "Klingon Empire") (adjective "Klingon"))
  344.   ((adjective "Vulcan"))
  345.   ((adjective "Jedi"))
  346.   ((name "Romulus") (adjective "Romulan"))
  347.   ((adjective "Rebel"))
  348.   ((adjective "Corazan"))
  349.   ((name "Earth") (adjective "Terran"))
  350.   ((adjective "Cylon"))
  351.   ((adjective "Orion"))
  352.   ((adjective "Ferengi"))
  353.   ((adjective "Zen"))
  354.   ((adjective "Time Lord"))
  355.   ((adjective "Kharg"))
  356.   ((adjective "Cyborg"))
  357.   ((adjective "Dalek"))
  358.   ((adjective "Kelvin"))
  359.   ((adjective "Goth"))
  360.   ((adjective "Vogon"))
  361. ))
  362.  
  363. (add (x X) namer "random-planets")
  364.  
  365. (namer random-planets (random
  366. "Argon" "Tertulian" "Atlantis" "Isis" "Cuthka"
  367. "Prene" "Ziul" "Aja" "Hukan" "Burran" 
  368. "Zenon" "Vorscica" "Khakan" "Trantor" "Solcan"
  369. "Cjiny" "Caligula" "Ipaar" "Ryurr" "Mentha"
  370. "Vrudn" "Martel" "Loki" "Mendelan"
  371. "Saure" "Juvak" "Kaos" "Irrenbuk" "Calazan"
  372. "Ether" "Astral" "Keeguran" "Dospas" "Centari"
  373. "Alpha" "Guerilli" "Galeo" "Charon" "Appolo"
  374. "Ulam Batar" "Urishina" "Zaariana" "Shadowfax"
  375. "Cloudy Coffee"  "with nice beaches" "of the Apes"
  376. "Kyuin" "Reydak" "Baal" "Geryon" "Dispater"
  377. "Azurn" "Mythos" "Nantes" "Kourion" "Turton"
  378. "Moori" "Pelanda" "Sirith" "Celan" "Corolla"
  379. "Muur" "Sol Invictus" "Saladan" "Samnth" "Awe"
  380. "Kvack" "Portuli" "Turin" "Anthran" "Xerxes"
  381. "Zeus" "Keno" "Terre" "Vito" "Vishnu" 
  382. "Visigoth" "Romulus" "Kresge" "Kor" "Kolkhoz"
  383. "Algol" "Quixote" "Quirinal" "Chisholm" 
  384. "Archangel" "Ariananus" "Buran" "Kea" "Tara"
  385. "Gustavus" "Antioch" "Piraeus" "Vaudois" "Vault"
  386. "Rastaan" "Daggoroth" "Beina" "Breton" 
  387. "Gallivent" "Galaak" "Galifre" "Lise" "Abidjan"
  388. "Acanthus" "Achilles" "Actaeon" "Adelia" "Adonis"
  389. "Axla" "Alnu" "Alcestis" "Alkmena" "Alexei"
  390. "Garcia" "New Peoria" "Penelope" "Taurus"
  391. "Bevois" "Odin" "Dwyer" "Aegean" "Vega"
  392. "Altar" "Betelgeuse" "Aldebaran" "Procyon"
  393. "Spica" "Lapella" "Deneb" "Venus" "Mars" 
  394. "Io" "Ganymede" "Europa" "Rigel" "Rigel VII"
  395. "Rigel XII" "DeLorian" "Pyrrus" "New Warth"
  396. "Dorsai" "Xax" "Cygnus X-1" ; its really a black hole but..
  397. "Terminus"  "Felicity" "Sanction" "goes BOOM"
  398. ))
  399.  
  400. (game-module (notes (
  401.   "This period has a number of strange features:"
  402.   " Stormtroopers are terriblly loyal. On your command,"
  403.   "  they will move into outer-space and suffocate."
  404.   " Photon torpedos are generally the most effective means"
  405.   "  of destroying enemy ships; but hold your fire until "
  406.   "  you have enough for the kill."
  407.   " SF-1 fighters have a "Skywalker" chance of destroying Death"
  408.   "  Stars.  Naturally, its a suicide run.  "
  409.   " Blackholes will eat any ships you put into them.  So"
  410.   "  watch for them."
  411.   ""
  412.   "The machine players haven't figured any of this out. "
  413.   " Thus, their play is less than wonderful."
  414.   ""
  415.   ""
  416. ;; this should probably be part of the module header,
  417. ;; so can be displayed in appropriate contexts.
  418.   " by Victor Mascari"
  419.   "Copyright 1991, Henry Ware & Victor Mascari"
  420.   "Please distribute this, rewrite it etc. However,"
  421.   "you may not sell it, and this message must remain"
  422.   "intact.  Of course, if you do any of these things, we"
  423.   "will never know."
  424.   "Converted to version 7 by Stan Shebs."
  425.   ""
  426.   " Thanks to the writter of the 'Starwars'"
  427.   "  period for icons and ideas, and to "
  428.   "  Henry Ware for some icons and technical"
  429.   "  advice."
  430.  
  431.   "This period was written by Victor Mascari at The Ohio State University."
  432.   ""
  433.   "Strategy depends upon size of the map you're playing on. The smaller the"
  434.   "map, the smaller unit that should be built. Large maps require big fleets."
  435.   ""
  436.   "Fleets tend to be the preferred method of warfare. In addition, the person"
  437.   "that attacks first usually wins, so gather as much intelligence about"
  438.   "the movements of the enemy as possible, and keep main battle fleet away "
  439.   "from his until you can strike with full force."
  440.   ""
  441.   "Nebula hide ships 80% of the time, but also slow them down."
  442.   ""
  443.   "5 photon torpedos are needed to destroy a moon, 8 for a planet."
  444.   ""
  445.   "Blackholes are hard to spot, so pay attention to where your moving or else"
  446.   "you'll loose your ship."
  447.   ""
  448.   "The computer is fairly stupid in this period and is fairly easy to defeat. The"
  449.   "skills learned to defeat the computer will, in general, not apply to human"
  450.   "opponents."
  451. )))
  452.  
  453. (add @ notes (
  454.   "The Deathstar is the more powerful unit in this period.  In close quarters"
  455.   "other units can be flattened, however deathstar can be captured by"
  456.   "storm troopers and have some vunerability to fighters. They are the"
  457.   "only moving unit which repairs itself once a turn."
  458. ))
  459. (add p notes (
  460.   "The Photon Torpedo is the main means of attack.  It has a range of seven and"
  461.   "does two points to ships and five to planets.  Its often wise to save these"
  462.   "until you have enough to kill a big ship in one turn: wounded ships often "
  463.   "make it home."
  464. ))
  465. (add s notes (
  466.   "Storm Trooper suffocate in outerspace, so don't put them there.  "
  467. ))
  468. (add f notes (
  469.   "Fighters are good for reconnaissance and for harrasing the enemy battle "
  470.   "cruisers.  Send them take a point point of damage and come home. As"
  471.   "previously mentioned they have a slim chance of destroying a death star"
  472.   "in one hit, however, its a suicide run."
  473. ))
  474. (add t notes (
  475.   "Transports are, naturally, vulnerable and sorta slow."
  476. ))
  477. (add l notes (
  478.   "Light Cruisers are the smallest of the fleet ships.  They are very vulnerable"
  479.   "in fleet combat however, especially to dreadnoughts.  They are good at "
  480.   "reconnaissance.  They can be used as batteries to provide photon"
  481.   "torpedos, but they don't make many.  The main use of light cruisers"
  482.   "is to provide bait to attract his ships or, occasionally, to eat up his"
  483.   "photon torpedos."
  484. ))
  485. (add b notes (
  486.   "Battle Cruisers provide photon torpedos.  Generally, they provide the"
  487.   "backbone of a battle fleet."
  488. ))
  489. (add d notes (
  490.   "Dreadnoughts are the largest of the fleet ships and are tough in close "
  491.   "combat.  But, despite the name, it best to play these ships with a "
  492.   "certain amount of caution; one dreadnought can not take on a fleet, "
  493.   "and deathstars demand a respectful amount of distance."
  494. ))
  495.  
  496. (add x notes (
  497.   "Planets and Moons are the main producers.  Generally, the more powerful"
  498.   "the unit to be constructed, the better it is to produce it in a planet."
  499.   "As for the defense of these units, there are several schools of thought."
  500.   "One school says the best defense is a good offense.  Another holds"
  501.   "that fighter patrols are cheap and effective against enemy landings."
  502.   "Or that a loaded transport should be kept to retake any enemy conquests,"
  503.   "and as defense against a deathstar.  Some people like to supply their"
  504.   "planets with a large number of torpedos.  Finally, some people like to"
  505.   "let the enemy bombard their planets, thus 'wasting' torpedos and "
  506.   "allowing the defender to destroy the attacking fleet.   "
  507. ))
  508.  
  509. (add X notes (
  510.   "Planets and Moons are the main producers.  Generally, the more powerful"
  511.   "the unit to be constructed, the better it is to produce it in a planet."
  512.   "As for the defense of these units, there are several schools of thought."
  513.   "One school says the best defense is a good offense.  Another holds"
  514.   "that fighter patrols are cheap and effective against enemy landings."
  515.   "Or that a loaded transport should be kept to retake any enemy conquests,"
  516.   "and as defense against a deathstar.  Some people like to supply their"
  517.   "planets with a large number of torpedos.  Finally, some people like to"
  518.   "let the enemy bombard their planets, thus 'wasting' torpedos and "
  519.   "allowing the defender to destroy the attacking fleet.   "
  520. ))
  521.  
  522.